<?php

/**
 * EncDireccion filter form base class.
 *
 * @package    encuestas
 * @subpackage filter
 * @author     qualem
 */
abstract class BaseEncDireccionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'persona_id'           => new sfWidgetFormPropelChoice(array('model' => 'EncPersona', 'add_empty' => true)),
      'calle'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'numero'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'colonia'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'delegacion_municipio' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'referencia'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'estado'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'persona_id'           => new sfValidatorPropelChoice(array('required' => false, 'model' => 'EncPersona', 'column' => 'id')),
      'calle'                => new sfValidatorPass(array('required' => false)),
      'numero'               => new sfValidatorPass(array('required' => false)),
      'colonia'              => new sfValidatorPass(array('required' => false)),
      'delegacion_municipio' => new sfValidatorPass(array('required' => false)),
      'referencia'           => new sfValidatorPass(array('required' => false)),
      'estado'               => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('enc_direccion_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'EncDireccion';
  }

  public function getFields()
  {
    return array(
      'id'                   => 'Number',
      'persona_id'           => 'ForeignKey',
      'calle'                => 'Text',
      'numero'               => 'Text',
      'colonia'              => 'Text',
      'delegacion_municipio' => 'Text',
      'referencia'           => 'Text',
      'estado'               => 'Text',
    );
  }
}
